package com.whu.waterworks.action;


import com.opensymphony.xwork2.ActionSupport;
import com.whu.waterworks.dto.GisTodayStationData;
import com.whu.waterworks.model.Realtimedata;
import com.whu.waterworks.service.DataService;

public class GisGetTodayStationDataRecentlyAction extends ActionSupport {
    /**
	 * 
	 */
	private static final long serialVersionUID = 3336994524104936646L;
	private String code;
    private String type;
    private GisTodayStationData data;
	private DataService dataService;
    public String getRecentlyValue()
    {
    	Realtimedata realtimedata = dataService.getTodayWaterDataByIdType(code,type);
		data = new GisTodayStationData();
    	if(realtimedata != null)
    	{
            data.setValue(realtimedata.getValue());
            data.setDate(realtimedata.getId().getTime().substring(11));
    	}
    	return SUCCESS;
    }
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public GisTodayStationData getData() {
		return data;
	}
	public void setData(GisTodayStationData data) {
		this.data = data;
	}
	public DataService getDataService() {
		return dataService;
	}
	public void setDataService(DataService dataService) {
		this.dataService = dataService;
	}
    
}
